Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology-aware: implement metrics collection. #392

Closed
wants to merge 2 commits into from

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Nov 1, 2024

Implement metrics collection for the topology-aware policy. Collect per zone (IOW per pool) prometheus

  • name, cpuset and memset
  • shared pool capacity, allocation, available amount
  • memory capacity, allocation, available amount
  • number of containers
  • number of containers in the shared pool

@klihub klihub requested review from kad and marquiz November 1, 2024 17:23
@klihub klihub force-pushed the devel/topology-aware/metrics branch 3 times, most recently from bf77d0c to f2b8541 Compare November 3, 2024 15:11
@klihub klihub marked this pull request as ready for review November 3, 2024 15:11
var metrics []prometheus.Metric

metrics = append(metrics,
prometheus.MustNewConstMetric(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the use of "throwaway" const metric? I'd think about initializing a list of persistent gauges and using the Set method to update the value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I mindlessly copied the pattern of implementation from balloons without understanding what I am actually doing... Let me try to read up on this a bit more and fix it.

pkg/resmgr/lib/memory/zones.go Outdated Show resolved Hide resolved
@@ -45,6 +45,11 @@ func (a *Allocator) ZoneFree(zone NodeMask) int64 {
return a.zoneFree(zone & a.masks.nodes.hasMemory)
}

// ZoneAvailable returns the amount of available memory in the zone.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meaning of "available" is not very clear to me. Maybe this public method comment could help understanding why ZoneAvailable != ZoneFree (where ZoneFree = ZoneCapacity - ZoneUsage). Can it be that ZoneAvailable at t=0 is smaller than ZoneUsage at t=1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZoneFree returns the amount of free capacity in this zone, taking into account allocations in this zone and any only this zone and its subzones. ZoneAvailable returns ZoneFree capped to the minimum free capacity of any of the (larger super-)zones this zone is a genuine subzone of. IOW, it returns the amount of memory allocatable from this zone.

@askervin
Copy link
Collaborator

askervin commented Nov 5, 2024

Beside these comments, I think this already looks very good.

Add ZoneAvailable to return the amount of available/allocatable
memory in a zone, capped by the amount of free memory in any of
the ancestors of a zone.

Signed-off-by: Krisztian Litkey <[email protected]>
Implement collection of per zone prometheus metrics.
Currently we collect for each pool/zone the following
  - name, cpuset and memset
  - shared pool capacity, allocation, available amount
  - memory capacity, allocation, available amount
  - number of containers
  - number of containers in the shared pool

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the devel/topology-aware/metrics branch from f2b8541 to 637f48a Compare November 5, 2024 08:32
@klihub
Copy link
Collaborator Author

klihub commented Nov 11, 2024

@marquiz @askervin I close this and reopened a reworked version stacked on top of the rest of my metrics series as #406.

@klihub klihub closed this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants